product_list = [
    ('HUAWEI P30', 3800),
    ('Macbook pro', 16000),
    ('Nike', 850),
    ('milk tea', 15),
    ('Head first Python', 128),
    ('crabs', 88),
]
shopping_cart = []
Alipay_balance = input("Alipay_balance：")
while True:
    for item in product_list:
       print(product_list.index(item),item)
    user_choice = input("请选择商品编号:")
    if user_choice.isdigit():
        user_choice =int(user_choice)
        if user_choice>=0 and user_choice<6:
          product_item =  product_list[user_choice]
          if Alipay_balance >= product_item[1]:
              Alipay_balance = Alipay_balance - product_item[1]
              shopping_cart.append(product_item)
              print("added %s to your shopping cart,your current Alipay balance is %s" %(product_item[0],Alipay_balance))
        else:
            print("您的余额不足，请使用花呗或购买其他商品。您的余额为：%s" %(Alipay_balance))
    elif user_choice == "q":
        print("--------shopping list-------")
        for item2 in shopping_cart:
            print(item2)
            print("Alipay_balance: %s" %(Alipay_balance))
        break
    else:
        print("您输入的商品不存在，请输入正确的商品编号：")